<template>
	<view class="homeLayout pageBg">
		<custom-nav-bar title="首页"></custom-nav-bar>
		<view class="banner">
			<swiper indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#fff" autoplay
				circular>
				<swiper-item v-for="i in swiperImages" :key="i.id">
					<image :src="i.picurl" mode="aspectFill" @click="pageGoing('/pages/preview/preview')"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="notice">
			<view class="left">
				<uni-icons type="sound-filled" size="20"></uni-icons>
				<text>公告</text>
			</view>
			<view class="center">
				<swiper vertical autoplay interval="1500" duration="300" circular>
					<swiper-item v-for="i in 4" @click="pageGoing('/pages/notice/detail')">
						轮播内容
					</swiper-item>
				</swiper>
			</view>
			<view class="right">
				<uni-icons type="right" size="20" color="#333" @click="pageGoing('/pages/notice/notice')"></uni-icons>
			</view>
		</view>

		<view class="select">
			<common-title>
				<template #name>
					每日推荐
				</template>
				<template #custom>
					<view class="date">
						<uni-icons type="calendar" size="26"></uni-icons>
						<uni-dateformat :date="Date.now()" format="MM月dd日"></uni-dateformat>
					</view>
				</template>
			</common-title>

			<view class="content">
				<scroll-view scroll-x="true">
					<view class="box" v-for="i in selectImages" :key="i.id">
						<image :src="i.picurl" @click="pageGoing('/pages/preview/preview')" mode="aspectFill"></image>
					</view>
				</scroll-view>
			</view>
		</view>

		<view class="theme">
			<common-title>
				<template #name>
					专题精选
				</template>
				<template #custom>
					<view class="moreBox">
						<uni-icons type="redo" size="26"></uni-icons>
						<view class="more">More</view>
					</view>
				</template>
			</common-title>
			<view class="content">
				<theme-item v-for="item in themeImages" :themeImage="item">

				</theme-item>
				<theme-item :isMore="true">

				</theme-item>
			</view>
		</view>
	</view>
</template>

<script>
	import { pageGoing } from '../../utils/pageGoIng'
	export default {
		data() {
			return {
				swiperImages: [{
						id: "1",
						picurl: "https://ts1.tc.mm.bing.net/th/id/R-C.13a9b8b347651d085c7bf90fbace5624?rik=q6t2JgkiiYcgzg&riu=http%3a%2f%2fp2.qhimgs4.com%2ft01fd61ef8c5088feff.jpg&ehk=jhcduyGu1W8AU4aQQPNj6%2feRs3UuA1fOsBzhWM5qVa0%3d&risl=&pid=ImgRaw&r=0"
					},
					{
						id: "2",
						picurl: "https://ts1.tc.mm.bing.net/th/id/R-C.2a49d9f3677d83a9a2d8849f1442bb22?rik=DpSAj9AUyR4RrA&riu=http%3a%2f%2ffile.51pptmoban.com%2fd%2ffile%2f2023%2f06%2f04%2fb3925630992729172938c08655e5cfd0.jpg&ehk=avAdUGiVQ52VCb2qjEv6sors6E%2bzLS0DO4tv4hnl6aw%3d&risl=&pid=ImgRaw&r=0"
					},
					{
						id: "3",
						picurl: "https://img.shetu66.com/2023/06/28/1687937373741115.png"
					},
					{
						id: "4",
						picurl: "https://pic.616pic.com/bg_w1180/00/00/81/zi58oHApHm.jpg!/fw/880"
					}
				],

				selectImages: [{
						id: "1",
						picurl: "https://img.keaitupian.cn/newupload/05/1683621565610736.jpg"
					},
					{
						id: "2",
						picurl: "https://img.keaitupian.cn/newupload/08/1629449018344288.jpg"
					},
					{
						id: "3",
						picurl: "https://pic2.zhimg.com/v2-0dda71bc9ced142bf7bb2d6adbebe4f0_r.jpg?source=1940ef5c"
					},
					{
						id: "4",
						picurl: "https://b.zol-img.com.cn/sjbizhi/images/11/1080x1920/1592964698813.jpg"
					},
					{
						id: "5",
						picurl: "https://pic3.zhimg.com/v2-bf80000c5a9d2c711c8261f1e5f975d1_r.jpg"
					},
					{
						id: "6",
						picurl: "https://pic2.zhimg.com/v2-72a2300d5166d34c8698ad9ef1fe9f9c_r.jpg?source=1940ef5c"
					},
					{
						id: "7",
						picurl: "https://pic4.zhimg.com/v2-c2b3eb3319d52218753d0ce20bc7c100_r.jpg"
					},
					{
						id: "8",
						picurl: "https://pic3.zhimg.com/v2-221a09c4cc03a43572e3d8946ed01f3c_r.jpg?source=1940ef5c"
					},
				],

				themeImages: [{
						id: "1",
						picsrc: "https://pica.zhimg.com/v2-e4e60a926de9293e9ec38b1eabb593b2_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "2",
						picsrc: "https://pic2.zhimg.com/v2-bb704875f41303cf4cef9d7eb418803d_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "3",
						picsrc: "https://pic4.zhimg.com/v2-22a434b5f322051ee0f838aa9b25b939_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "4",
						picsrc: "https://pic4.zhimg.com/v2-018795ae154cf339fefab9fcdb7fdc7a_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "5",
						picsrc: "https://pic3.zhimg.com/v2-5188eb36ca4e080f80de0a75669e7de8_r.jpg",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "6",
						picsrc: "https://pic4.zhimg.com/v2-f77e75995c247c301c564ad74e812fd5_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "7",
						picsrc: "https://pic1.zhimg.com/v2-b417dd08616723ef1ad531f5fd8e1d4f_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					},
					{
						id: "8",
						picsrc: "https://pic1.zhimg.com/v2-474122ad1e2fa1e421df21c485453f20_r.jpg?source=1940ef5c",
						mask: "动漫人物",
						tab: "热门壁纸"
					}
				],
				
			}
		},
		onLoad() {

		},
		methods: {
			pageGoing(path) {
				pageGoing(path)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.homeLayout {
		.banner {
			width: 750rpx;
			padding: 30rpx 0;

			swiper {
				width: 750rpx;
				height: 340rpx;

				&-item {
					width: 100%;
					height: 100%;
					padding: 0 25rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 12rpx;
					}
				}
			}
		}

		.notice {
			width: 690rpx;
			height: 80rpx;
			line-height: 80rpx;
			background-color: #f9f9f9;
			margin: 0 auto;
			border-radius: 80rpx;
			display: flex;

			.left {
				width: 140rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				:deep() {
					.uni-icons {
						color: $brand-theme-color !important;
					}
				}

				text {
					color: $brand-theme-color;
					font-weight: 600;
					font-size: 28rpx
				}
			}

			.center {
				flex: 1;

				swiper {
					height: 100%;

					&-item {
						height: 100%;
						font-size: 30rpx;
						color: #666;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
				}
			}

			.right {
				width: 80rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}

		}

		.select {
			padding-top: 50rpx;

			.date {
				display: flex;
				align-items: center;
				justify-content: center;
				gap: 0 10rpx;
				color: $brand-theme-color;

				:deep() {
					.uni-icons {
						color: $brand-theme-color !important;
					}
				}
			}

			.content {
				width: 720rpx;
				margin-left: 30rpx;
				margin-top: 30rpx;

				scroll-view {
					white-space: nowrap;

					.box {
						width: 200rpx;
						height: 430rpx;
						display: inline-block;
						margin-right: 15rpx;

						image {
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}

					.box:last-child {
						margin-right: 30rpx;
					}
				}
			}
		}

		.theme {
			padding: 50rpx 0;

			.moreBox {
				display: flex;
				align-items: center;
				justify-content: center;
				gap: 0 10rpx;

				:deep() {
					.uni-icons {
						color: $brand-theme-color !important;
					}
				}

				.more {
					color: $brand-theme-color;
				}
			}


			.content {
				margin-top: 30rpx;
				padding: 0 30rpx;
				display: grid;
				gap: 15rpx;
				grid-template-columns: repeat(3, 1fr);
			}
		}



	}
</style>